<template>
  <div class="review-item">
    <div class="review-header">
      <strong>From User: {{ review.from_user_name }}</strong>
      <span>{{ new Date(review.date).toLocaleDateString() }}</span>
    </div>
    <p>{{ review.content }}</p>
  </div>
</template>

<script lang="ts">
import type {Review} from '../../utility/interfaces';
export default {
  props: ["review"],
  methods: {
    likeReview() {
      this.$emit('like-review', this.review.id);
    },
  },
};
</script>

<style scoped>
.review-item {
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
}
.review-header {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
}
</style>
